[20250410] BOJ / P4 / 광고 / 권혁준 #306
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧷 문제 링크
https://www.acmicpc.net/problem/1305
🧭 풀이 시간
15분
👀 체감 난이도
✏️ 문제 설명
전광판에 표시된 길이 L인 문자열이 표시된다.
이 전광판의 문자열은 어떤 문자열 S를 무한히 이어붙인 문자열 중 길이 L만큼을 표시한다.
가능한 S의 최소 길이를 구해보자.
🔍 풀이 방법
[사용한 알고리즘]
주어지는 문자열은$...SSSSS...$ 형태이다.
접두사와 접미사가 겹치는 최대 부분을 찾아서 한 쪽을 제거하면 S를 찾을 수 있다.
⏳ 회고
어렵다